/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/11/28
*/
#ifndef __EDUI_LUAMGR_H__
#define __EDUI_LUAMGR_H__

#include "../core/Base.h"

#ifdef EDUI_USE_LUAPLUS

EDUI_NAMESPACE_BEGIN

#define LuaMgrPtr (IEnginePtr->GetLuaMgr())

class EDUI_API LuaMgr
{
public:
    LuaMgr();
    ~LuaMgr();
public:
    bool Init();
    bool DoFile(const char* file);
    void Quit();
    //get LuaPlus::LuaState
    void* GetLuaState() const;

    //add the data to saved Luaclass objects
    void Add(const char* key, void* data);
    //remove the data from saved Luaclass objects
    void Remove(void* data);
    //objects do event
    void DoEvent(void* data, const char* eventname);
    //objects do timer
    Uint32 DoTimer(void* key, TimerID id, Uint32 interval);
protected:
    //LuaPlus::LuaState
    void *m_lua;
};

EDUI_NAMESPACE_END

#endif
#endif